home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / ARCNET.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-23  |  1.0 KB  |  45 lines

  1. /* Generic ARCnet constants and templates */
  2.  
  3. #ifndef    _ARCNET_H
  4. #define    _ARCNET_H
  5.  
  6. #ifndef    _GLOBAL_H
  7. #include "global.h"
  8. #endif
  9.  
  10. #ifndef    _MBUF_H
  11. #include "mbuf.h"
  12. #endif
  13.  
  14. #ifndef    _IFACE_H
  15. #include "iface.h"
  16. #endif
  17.  
  18. #define    AADDR_LEN    1
  19. /* Format of an ARCnet header */
  20. struct arc {
  21.     uint8 source[AADDR_LEN];
  22.     uint8 dest[AADDR_LEN];
  23.     uint8 type;
  24. };
  25. #define    ARCLEN    3
  26.  
  27. /* ARCnet broadcast address */
  28. extern uint8 ARC_bdcst[];
  29.  
  30. /* ARCnet type fields */
  31. #define    ARC_IP        0xf0    /* Type field for IP */
  32. #define    ARC_ARP        0xf1    /* Type field for ARP */
  33.  
  34. /* In file arcnet.c: */
  35. void htonarc(struct arc *arc,struct mbuf **data);
  36. int ntoharc(struct arc *arc,struct mbuf **bpp);
  37. char *parc(char *out,uint8 *addr);
  38. int garc(uint8 *out,const char *cp);
  39. int anet_send(struct mbuf **bp,struct iface *iface,uint32 gateway,uint8 tos);
  40. int anet_output(struct iface *iface,uint8 dest[],uint8 source[],uint type,
  41.     struct mbuf **data);
  42. void aproc(struct iface *iface,struct mbuf *bp);
  43.  
  44. #endif    /* _ARCNET_H */
  45.